/**
 * Copyright ©2012-2018 HopeHaiyang Corporation, All Rights Reserved
 * http://www.wuhanhope.com
 */
package hope.platform.data.web;

import hope.platform.data.domain.HopeExceptionKind;
import hope.platform.data.server.data.header.HopeExceptionKindService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * class info
 *
 * @author hujia
 *         Create at 2018/7/20 15:41
 */
@RestController
@RequestMapping("/exceptionKind")
public class HopeExceptionKindController {

    @Autowired
    private HopeExceptionKindService service;

    @RequestMapping(method = RequestMethod.POST)
    public HopeExceptionKind addHopeExceptionKind(@RequestBody HopeExceptionKind hopeExceptionKind) throws Exception {
        return service.addHopeExceptionKind(hopeExceptionKind);
    }

    @RequestMapping(value = "/all",method = RequestMethod.GET)
    public List<HopeExceptionKind> getAll(){
        return service.getAll();
    }

}
